package com.novellotus.iov.carvice.retrofit;


import java.io.Serializable;

/**
 * Created by Rich on 2017/8/3.
 */

public class BaseEntity<T> implements Serializable {
    private int code;
    private String msg;
    private T data;

    public boolean isSuccess() {
        return code == 200;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        if (code == 200) {
            return data;
        } else {
            return null;
        }

    }

    public void setData(T data) {
        if (code == 200) {
            this.data = data;
        } else if (code == 427) {

        } else {
            this.data = null;
        }
    }

}
